package com.yyfax.infrastructure;

import android.os.SystemClock;
import com.yyfax.common.CLog;

/**
 * Created by HenryZhang on 2016/10/19.
 * Copyright © 2016 www.yyfax.com. All Rights Reserved.
 */
public class Constants {
	private static final String TAG = "Constants";

	public static boolean DEBUG_TOGGLE = true;//BuildConfig.DEBUG

	/**网络连接状态 true:有网络; false:无网络*/
	public static boolean isConnected = true;
	/**
	 * 是否是模拟器
	 */
	public static boolean sIsEmulator = false;

	public static final String APK_DOWNLOAD_URL = "apk_url";
	public static final String APPLICATION_ID = "application_id";

	/**设备开机至今所消逝的时间*/
	public static long TIME_ELAPSED;
	/**服务器同步时间（一般不是最新，不能直接调用）*/
	public static long TIME_DELTA;

	/**获取最新的服务器同步时间*/
	public static long getRealTime() {
		long elapsed = SystemClock.elapsedRealtime();
		long realTime = TIME_DELTA + (elapsed - TIME_ELAPSED);
		CLog.i(TAG, "realTime = " + realTime + "; elapsed = " + elapsed + ", firstReqTimeOfElapsed = " + TIME_ELAPSED);
		return realTime;
	}
}
